<%@ taglib prefix="spring-tags" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="spring-form" uri="http://www.springframework.org/tags/form"%>
<%@ page
    import="org.jiscinvolve.astrodabis.mallow.model.api.Tag"
    import="org.jiscinvolve.astrodabis.mallow.model.api.Query"
    import="org.jiscinvolve.astrodabis.mallow.model.api.QueryTag"
    import="org.jiscinvolve.astrodabis.mallow.model.api.Result"
    import="org.jiscinvolve.astrodabis.mallow.model.api.Account"
    import="org.jiscinvolve.astrodabis.mallow.model.tap.TapService"
    import="org.jiscinvolve.astrodabis.mallow.control.ViewData"
    session="true"
%>
<%@ include file="/jsp/init.jsp" %>
<%@ include file="/jsp/queries/init.jsp" %>
<html>
    <head>
	    <title>AstroDAbis query <%= query.name() %></title>
    </head>
    <body>
        <%@ include file="/jsp/menu.jsp" %>
	    <div>
	        <h2>Query <%= query.name() %></h2>
            <fieldset>
                <legend>Query details</legend>
                <div>
                    <div style='float:right' >
                        <img src='<%= data.qrcode(data.path(query)) %>' alt='QRCode'/>
                    </div>
                    <div>
                        <ul>
                            <li>
                                Name : <%= query.name() %>
                            </li>
                            <li>
                                Owner : <a href='<%= data.path(query.owner()) %>'><%= query.owner().name() %></a>
                            </li>
                            <li>
                                Status : <%= query.status() %>
                            </li>
                        </ul>
                    </div>
                </div>
            </fieldset>

            <fieldset>
                <legend>Add a tag</legend>
      			<spring-form:errors path="form"/>
		        <spring-form:form method="post" modelAttribute="form">
		          	<fieldset>
		          		<legend>Name</legend>
		          		<spring-form:input  path="name"/>
	          			<spring-form:errors path="name"/>
		          	</fieldset>
			        <div>
			            <button type="submit" name="add">Add</button>
		            </div>
		        </spring-form:form>

            </fieldset>
	    </div>
    </body>
</html>

